﻿using IOA.MES.DataAccess.Enum;
using IOA.MES.PdaApi.Models.Response.Product;
using System;
using System.Collections.Generic;

namespace IOA.MES.PdaApi.Models.Response.Outbound
{
    /// <summary>
    /// 查询出库记录返回对象
    /// </summary>
    public class QueryOutboundsResponse
    {
        /// <summary>
        /// 出库任务列表
        /// </summary>
        public List<Outbound> Outbounds { get; set; } = new List<Outbound>();
    }

    /// <summary>
    /// 出库对象
    /// </summary>
    public class Outbound
    {
        /// <summary>
        /// 出库单号
        /// </summary>
        public string OutboundNo { get; set; }

        /// <summary>
        /// 出库仓库代码
        /// </summary>
        public string WarehouseCode { get; set; }

        /// <summary>
        /// 出库仓库名称
        /// </summary>
        public string WarehouseName { get; set; }

        /// <summary>
        /// 柜号
        /// </summary>
        public string CabinetNo { get; set; }

        /// <summary>
        /// 出库数量
        /// </summary>
        public int Quantity { get; set; }

        /// <summary>
        /// 已出库数量
        /// </summary>
        public int OutboundedQuantity { get; set; }

        /// <summary>
        /// 出库状态
        /// </summary>
        public OutboundStatus Status { get; set; }

        /// <summary>
        /// 出库状态（文本）
        /// </summary>
        public string CNStatus
        {
            get { return !System.Enum.IsDefined(typeof(OutboundStatus), Status) ? string.Empty : EnumConvert.ToDesc(Status); }
        }

        /// <summary>
        /// 出库人
        /// </summary>
        public string OutboundBy { get; set; }

        /// <summary>
        /// 出库时间
        /// </summary>
        public DateTime? OutboundTime { get; set; }

        /// <summary>
        /// 包装清单
        /// </summary>
        public List<OutboundPack> Packs { get; set; } = new List<OutboundPack>();
    }

    /// <summary>
    /// 出库包对象
    /// </summary>
    public class OutboundPack
    {
        /// <summary>
        /// 包装批次号
        /// </summary>
        public string PackBatchNo { get; set; }

        /// <summary>
        /// 包装编号
        /// </summary>
        public string PackNo { get; set; }

        /// <summary>
        /// 库区编码
        /// </summary>
        public string AreaCode { get; set; }

        /// <summary>
        /// 库区名称
        /// </summary>
        public string AreaName { get; set; }

        /// <summary>
        /// 库位
        /// </summary>
        public string Location { get; set; }

        /// <summary>
        /// 是否已出库
        /// </summary>
        public bool Outbounded { get; set; }
    }
}
